import Stations from './Stations';
import styles from './index.less';

const StationInfo = (props) => {
  const { value, lineId } = props;

  // 直接使用props数据，不使用state
  const emptyStations = value?.filter?.((item) => item.direction === 0) ?? [];
  const heavyStations = value?.filter?.((item) => item.direction === 1) ?? [];

  return (
    <div className={styles.stationInfo}>
      <section className={styles.section}>
        <div className={styles.sectionItem}>
          <Stations type={0} dataSource={emptyStations} />
        </div>
        <div className={styles.sectionItem}>
          <Stations type={1} dataSource={heavyStations} />
        </div>
      </section>
    </div>
  );
};

export default StationInfo;
